package it.scambiocorse.rowmapper;

import it.scambiocorse.model.AreaType;
import it.scambiocorse.model.UtenteType;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class AreaUserRowMapper implements RowMapper  {

	  public Object mapRow(ResultSet resultSet, int row) throws SQLException {
	  	UtenteType u = new UtenteType();
	    AreaType area= new AreaType();
	    area.setIdArea(resultSet.getInt("id_area"));
	    area.setNomeArea(resultSet.getString("nome_area"));
	    area.setScambiati(resultSet.getDouble("dare"));
	    area.setPresi(resultSet.getInt("avere"));
	    area.setScambiatiItem(resultSet.getInt("dare_item"));
	    area.setPresiItem(resultSet.getInt("dare_item"));
	    
	    u.setAppoNomeArea(resultSet.getString("nome_area"));
	    u.setIdUser(resultSet.getInt("id_user"));
	    u.setLogin(resultSet.getString("login"));
	    u.setNome(resultSet.getString("nome"));
	    u.setCognome(resultSet.getString("cogn"));
	    u.setRagiSoci(resultSet.getString("ragi_soci"));
	    
	    
	    
	    return u;
	  }

	

}
